//
//  ZMYNetWorkAPI.h
//  奇阅
//
//  Created by 奇阅科技 on 14-10-20.
//  Copyright (c) 2014年 奇阅科技. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "MKNetworkKit.h"
#import "AdtHelper.h"
#define SERVER      @"dataapi.yuewen.cc"
#define YiDongSERVER      @"wap.iqiyoo.com"
#define YiDongChapterSERVER      @"wap.cmread.com"
//#define SERVER      @"api.local.com"
#define PRIVATE_KEY @"pKKDTKPHq5qBX5jT@!="
typedef void (^ResultArray)(NSArray *resultArray);
typedef void (^MYErrorBlock)(NSString *errorStr);
typedef void (^MYResultBlock)(NSDictionary *resultDic);
typedef void (^MYProgressBlock)(CGFloat progres);
@interface ZMYNetWorkAPI : NSObject

///获取当前时间戳
+ (NSTimeInterval)currentTime;


+(ZMYNetWorkAPI *)default;
-(MKNetworkEngine *)createEngine;
///意见反馈
-(void)feedback:(NSString *)textStr response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///发送手机短信验证码
-(void)smsLogin:(NSString *)mobile response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///验证码通过后登陆或者注册
-(void)smsLoginMobileParam:(NSDictionary *)param response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///账号密码登录
-(void)loginUsername:(NSString *)username passwd:(NSString *)passwd response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///第三方登录
-(void)sinaQQLogin:(NSDictionary *)param response:(MYResultBlock)resultDict error:(MYErrorBlock)errorStrin;
///忘记密码请求验证短信
-(void)forgetPWgetSMS:(NSString *)mobile response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///绑定手机获取短信验证码
-(void)userBindingPhone:(NSString *)mobile response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///绑定手机验证码验证过后
-(void)userBindingPhoneRight:(NSString *)mobile response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///修改昵称
-(void)updateNickName:(NSString *)nickName response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///修改密码
-(void)changePasswd:(NSString *)oldPasswd new:(NSString *)newPasswd response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///活动信息
-(void)activity:(NSString *)position Response:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///积分兑换阅币
-(void)pointsExchangeRemain:(NSUInteger)points Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///修改头像
-(void)updateHeadImage:(UIImage *)image response:(MYResultBlock)resultDict progress:(MYProgressBlock)upProgress error:(MYErrorBlock)errorString;
///获取用户最新信息
-(void)getNewUserInfoResponse:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;

///获取书籍详情推荐位
-(void)getBookInfoRecommend:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///获取推荐图书
-(void)getRecommend:(ResultArray)resultArray error:(MYErrorBlock)errorString;

///获取书架列表
-(void)bookRackResultArray:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///加入书架
-(void)addBookRackArticleid:(NSString *)articleid response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///从书架中移除
-(void)removeBookRackArticleid:(NSString *)articleid response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;

///已购收藏书评数量
-(void)additionalResponse:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///已购收藏列表
-(void)isHadPay:(BOOL)isHadPay page:(NSInteger)page Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;



///获取已订阅的VIP作品，page从1开始
-(void)myVIPPage:(NSInteger)page Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///获取收藏作品
-(void)myFavorResultArray:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///加入收藏
-(void)addMyFavorArticleid:(NSString *)articleid response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///从收藏中移除
-(void)removeMyFavorArticleid:(NSString *)articleid response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;

///获取我的书评,page从1开始
-(void)myCommentPage:(NSInteger)page Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///获取一本书我的书评,page从1开始
-(void)getMyThemeComment:(Book *)book Page:(NSInteger)page Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///获取用户充值记录,page从1开始
-(void)getRechargeRecordPage:(NSInteger)page Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;


///获取作品详情
-(void)getArticle:(NSString *)articleid Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///获取作品书评
-(void)getThemeComment:(Book *)book commentsid:(NSString *)commentsid Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///获取一条主题书评的回复
-(void)getReplyCommentWithThemeComment:(ThemeComment *)themeComment pageCommentsId:(NSString *)pageCommentsId Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///赞一条评论
-(void)likeCommentWithThemeComment:(ThemeComment *)themeComment Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///提交主题评论
-(void)commentWithArticleid:(Book *)book content:(NSString *)contents response:(MYResultBlock)resultDict progress:(MYProgressBlock)upProgress error:(MYErrorBlock)errorString;
///回复主题评论
-(void)commentWithArticleid:(Book *)book ThemeComment:(ThemeComment *)comment ReplyComment:(ReplyComment *)replyComment content:(NSString *)contents response:(MYResultBlock)resultDict progress:(MYProgressBlock)upProgress error:(MYErrorBlock)errorString;

///书本章节列表
-(void)getBookChapterBook:(Book *)book Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///验证书本章节列表是否有更新
-(void)getBookChapterBookHash:(Book *)book Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;

///验证章节是否有下载权限
-(void)getDownloadChapterPermission:(NSString *)bookChapters Book:(Book *)book Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///取消所有验证章节是否有下载权限的请求
-(void)cancelAllPermissionNetworkOperation;
///章节扣费接口
-(void)getDownloadChargeForChapters:(NSString *)bookChapters Book:(Book *)book Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///取消所有章节扣费接口的请求
-(void)cancelAllChargeNetworkOperation;
///多章节下载
-(void)downloadChapterTextStr:(NSString *)bookChapters purviewMark:(NSString *)purviewMark Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///获取订单号
-(void)getProductIdReadPackage:(NSString *)readPackage Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///充值接口
-(void)updateYuebi:(RechargeRecord *)recharge Response:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;

///获取分类项目
-(void)getBookShopTitle;
///获取热门搜索
-(void)searchHotTitleResponse:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///搜索提示
-(void)searchPrompt:(NSString *)searckKey Response:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///搜索结果
-(void)searchResult:(NSString *)searckKey Response:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///搜索移动基地结果
-(void)searchYiDongResult:(NSString *)searckKey Response:(ResultArray)resultArray error:(MYErrorBlock)errorString;
///获取奇悠授权id号
-(void)getYiDongFromID:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///获取移动基地章节内容
-(void)getYiDongChapterText:(Book *)book ChapterID:(NSString *)chapterID ResultBlock:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///移动基地的登录
-(void)getYiDongLogin:(NSDictionary *)param ResultBlock:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///移动基地的订阅扣费
-(void)chargeForYiDongLogin:(NSString *)path ResultBlock:(MYResultBlock)resultDict error:(MYErrorBlock)errorString;
///分享一本书任务完成
-(void)taskFinsh;
@end
